<?php

namespace App\Http\Controllers\Admin;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Models\Admin\PayConfig;

class PayConfigController extends Controller
{
    // 初始化 支付配置
    public function iniPay(Request $request)
    {
        // 获取支付配置 => 验证 -> 获取
        $Pay = new PayConfig;
        $getPay = $Pay->analyPay($request['id'] ? $request['id'] : 0);
        return $getPay;
    }

    // 提交 支付配置
    public function paySubmit(Request $request)
    {
        // 验证字段合法性 => 提交数据
        $Pay = new PayConfig;
        $insertPay = $Pay->insertAnlayArr($request['id'], $request['data']);
        return $insertPay;
    }
}
